<?php
	
	if (!defined('EXPONENT')) exit('');
	exponent_flow_set(SYS_FLOW_PROTECTED);
	require_once(BASE."modules/formhelpermodule/formhelper.php");
	
	$id_cat = 0;
	if(isset($_REQUEST['id']))
	{
		$id_cat = intval($_REQUEST['id']);
	}
	
	$formhelper=new formhelper("bannermediamodule","_bannermedia_manager_title","_view_bannermedia",$loc);
	$formhelper->setGridType(FORMHELPER_GRID_TYPE_DATAGRID);
	$formhelper->setGridOptions("height",800);
	$formhelper->setGridOptions("idField","id");
    $formhelper->setGridOptions("singleSelect","true");
	$formhelper->setGridOptions("pagination",true);
	$formhelper->setGridOptions("pageNumber","1");
	$formhelper->setGridOptions("pageSize","20");
	$formhelper->setGridOptions("rownumbers",true);
	$formhelper->setGridID("bannermedia");
	$js=URL_FULL."modules/bannermediamodule/js/BannerManager.js";
	$formhelper->addJS($js);
	
	$formhelper->setColumnType(1);
	$formhelper->addColumn(array("field"=>"title","title"=>"Title",'width'=>100));
	$formhelper->addColumn(array("field"=>"file_id","title"=>"Path",'width'=>300));
	$formhelper->addColumn(array("field"=>"item_content","title"=>"Content",'width'=>300));
	$formhelper->addColumn(array("field"=>"item_type","title"=>"Type",'width'=>100));
	$formhelper->addColumn(array("field"=>"rank","title"=>"Rank",'width'=>100));
	$link_param = '/index.php?module=bannermediamodule&action=bannermedia_getjson&ajax_action=1';
	$formhelper->setURLDataStream($link_param);
	
	$formhelper->setGridOptions("onBeforeLoad","function(___form_onBeforeLoad");
	
	$toolbar_template=new template("bannermediamodule","_BannerMedia_Manager_ToolbarHTML",$loc);
	$toolbar_template->register_permissions(array('administrate',"configure"),$loc);
	$toolbar_html=$toolbar_template->render();
	$formhelper->addToolbarHTML($toolbar_html);
	$formhelper->register_permissions(array('administrate',"configure"),$loc);
	$formhelper->output();
?>
